/**
 * 软件合同配置数据 
 * Author:      yangjq 
 * CreateTime:  2023/10/24 08:22:32 
 * LastEditor:  yangjq 
 * ModifyTime:  2023/12/5 20:09:04 
 * Description: 
*/ 
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {h} from "vue";
import {Tag} from "ant-design-vue";
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '模块名称',
    align: "center",
    dataIndex: 'modulename'
  },
  {
    title: '许可名',
    align: "center",
    dataIndex: 'licensename',
  },
  {
    title: '是否展示',
    align: "center",
    dataIndex: 'isshow',
    customRender: (text: any) => {
      if (text.value==1){
        return h(Tag, { color: 'green' }, () => '正常展示' )
      }else{
        return h(Tag, { color: 'orange' }, () => '不展示' )
      }
    },
  },
  {
    title: '是否核心模块',
    align: "center",
    dataIndex: 'iskernel',
    customRender: (text: any) => {
      if (text.value==1){
        return h(Tag, { color: 'green' }, () => '核心' )
      }else{
        return h(Tag, { color: 'orange' }, () => '非核心' )
      }
    },
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '软件名称',
    field: 'softwareid',
    component: 'InputNumber',
  },
  {
    label: '模块名称',
    field: 'modulename',
    component: 'Input',
  },
  {
    label: 'licensename',
    field: 'licensename',
    component: 'Input',
  },
  {
    label: 'description',
    field: 'description',
    component: 'InputTextArea',
  },
  {
    label: 'iskernel',
    field: 'iskernel',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
